package org.openclinic.domain;

import javax.persistence.Column;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.validation.Valid;

@Entity
@DiscriminatorValue("1")
public class Customer extends User {

	private static final long serialVersionUID = -5098629313058972322L;

	@Valid
	private HealthInsurance healthInsurance;
	
	private String insuranceNumber;

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "insurance_id", nullable = false)
	public HealthInsurance getHealthInsurance() {
		return this.healthInsurance;
	}

	public void setHealthInsurance(HealthInsurance healthInsurance) {
		this.healthInsurance = healthInsurance;
	}

	@Column(name = "insurance_number", length = 25)
	public String getInsuranceNumber() {
		return this.insuranceNumber;
	}

	public void setInsuranceNumber(String insuranceNumber) {
		this.insuranceNumber = insuranceNumber;
	}
	
}
